//
//  CTDataGenerator.m
//  ConstellationTalk_0.1
//
//  Created by riley on 15/6/4.
//  Copyright (c) 2015年 riley chu. All rights reserved.
//

#import "CTDataGenerator.h"
#import "CTFile.h"
#import "CTDiscoveryItems.h"
#import "CTHomePageItems.h"
#import "CTMessageItems.h"
#import "CTUser.h"
#import "CTLogin.h"
#import "CTPublishItems.h"
#import "CTLogicItems.h"

@implementation CTDataGenerator


#pragma mark - publish -

+(NSArray *)generateEditeEmojiListItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * mutableListArray = [NSMutableArray arrayWithCapacity:0];
        
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:@"emojiList.plist"  fromDoc:CTFileDocLibrary fromPath:@"cacheData/publish"];
        NSMutableArray * infoMutableArr = [infoMutableDic objectForKey:@"list"];
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            for (NSDictionary * infoDic in infoMutableArr) {
                
                [mutableListArray removeAllObjects];
                
                CTEditeEmojiListItem * itm = [[CTEditeEmojiListItem alloc] init];
                itm.group_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"group_id"]];
                itm.topic = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"topic"]];
                
                NSArray * listArray = [infoDic objectForKey:@"list"];
                for (NSDictionary * listDic in listArray) {
                    CTEditeEmojiListDetailsItem * detailItem = [[CTEditeEmojiListDetailsItem alloc] init];
                    detailItem.scheme_id = [NSString stringWithFormat:@"%@",[listDic objectForKey:@"scheme_id"]];
                    detailItem.thumb = [NSString stringWithFormat:@"%@",[listDic objectForKey:@"thumb"]];
                    detailItem.url = [NSString stringWithFormat:@"%@",[listDic objectForKey:@"url"]];
                    
                    [mutableListArray addObject:detailItem];
                }
                
                itm.list = [mutableListArray copy];
                
                
                [mutableArr addObject:itm];
            }
        }
        
        arr = [mutableArr copy];
        mutableArr = nil;
        mutableListArray = nil;
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}


+(NSArray *)generateBubbleEmojiListItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * mutableListArray = [NSMutableArray arrayWithCapacity:0];
        
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:@"bubbleList.plist"  fromDoc:CTFileDocLibrary fromPath:@"cacheData/publish"];
        NSMutableArray * infoMutableArr = [infoMutableDic objectForKey:@"list"];
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            for (NSDictionary * infoDic in infoMutableArr) {
                
                [mutableListArray removeAllObjects];
                
                CTEditeBubbleListItem * itm = [[CTEditeBubbleListItem alloc] init];
                itm.bubble_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"id"]];
                itm.thumb = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"thumb"]];
                itm.url = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"url"]];
                itm.x = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"x"]];
                itm.y = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"y"]];
                itm.w = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"w"]];
                itm.h = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"h"]];
                itm.allow_flip = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"allow_flip"]];
                itm.text_color = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"text_color"]];
               
                [mutableArr addObject:itm];
            }
        }
        
        arr = [mutableArr copy];
        mutableArr = nil;
        mutableListArray = nil;
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}

+(NSArray *)generateDefaultBubbleEmojiListItems
{
    NSArray * arr;
    
    @try {
        NSMutableArray * defaultBubblesArray = [NSMutableArray arrayWithCapacity:0];
        
        for (int i = 0; i<6; i++) {
            CTEditeBubbleListItem * itm = [[CTEditeBubbleListItem alloc] init];
            itm.bubble_id = [NSString stringWithFormat:@"%d",0];
            if (i == 0) {
                itm.x = [NSString stringWithFormat:@"%@",@"44"];
                itm.y = [NSString stringWithFormat:@"%@",@"62"];
                itm.w = [NSString stringWithFormat:@"%@",@"208"];
                itm.h = [NSString stringWithFormat:@"%@",@"113"];
            }else if (i == 1){
                itm.x = [NSString stringWithFormat:@"%@",@"39"];
                itm.y = [NSString stringWithFormat:@"%@",@"59"];
                itm.w = [NSString stringWithFormat:@"%@",@"227"];
                itm.h = [NSString stringWithFormat:@"%@",@"168"];
            }else if (i == 2){
                itm.x = [NSString stringWithFormat:@"%@",@"27"];
                itm.y = [NSString stringWithFormat:@"%@",@"117"];
                itm.w = [NSString stringWithFormat:@"%@",@"233"];
                itm.h = [NSString stringWithFormat:@"%@",@"61"];
            }else if (i == 3){
                itm.x = [NSString stringWithFormat:@"%@",@"30"];
                itm.y = [NSString stringWithFormat:@"%@",@"44"];
                itm.w = [NSString stringWithFormat:@"%@",@"238"];
                itm.h = [NSString stringWithFormat:@"%@",@"168"];
            }else if (i == 4){
                itm.x = [NSString stringWithFormat:@"%@",@"42"];
                itm.y = [NSString stringWithFormat:@"%@",@"52"];
                itm.w = [NSString stringWithFormat:@"%@",@"142"];
                itm.h = [NSString stringWithFormat:@"%@",@"112"];
            }else if (i == 5){
                itm.x = [NSString stringWithFormat:@"%@",@"85"];
                itm.y = [NSString stringWithFormat:@"%@",@"33"];
                itm.w = [NSString stringWithFormat:@"%@",@"146"];
                itm.h = [NSString stringWithFormat:@"%@",@"214"];
            }
            
            itm.allow_flip = [NSString stringWithFormat:@"%@",@"1"];
            itm.text_color = [NSString stringWithFormat:@"%@",@"#000000"];
            
            NSString * imagName = [NSString stringWithFormat:@"bubble%d",i+1];
            itm.image = [UIImage imageNamed:imagName];
            
            [defaultBubblesArray addObject:itm];
        }
        
        for (int i = 0; i < 4; i++) {
            CTEditeBubbleListItem * itm = [[CTEditeBubbleListItem alloc] init];
            itm.bubble_id = [NSString stringWithFormat:@"%d",0];
            if (i == 0) {
                itm.x = [NSString stringWithFormat:@"%@",@"63"];
                itm.y = [NSString stringWithFormat:@"%@",@"81"];
                itm.w = [NSString stringWithFormat:@"%@",@"175"];
                itm.h = [NSString stringWithFormat:@"%@",@"119"];
            }else if (i == 1){
                itm.x = [NSString stringWithFormat:@"%@",@"53"];
                itm.y = [NSString stringWithFormat:@"%@",@"69"];
                itm.w = [NSString stringWithFormat:@"%@",@"194"];
                itm.h = [NSString stringWithFormat:@"%@",@"133"];
            }else if (i == 2){
                itm.x = [NSString stringWithFormat:@"%@",@"57"];
                itm.y = [NSString stringWithFormat:@"%@",@"67"];
                itm.w = [NSString stringWithFormat:@"%@",@"199"];
                itm.h = [NSString stringWithFormat:@"%@",@"129"];
            }else if (i == 3){
                itm.x = [NSString stringWithFormat:@"%@",@"48"];
                itm.y = [NSString stringWithFormat:@"%@",@"57"];
                itm.w = [NSString stringWithFormat:@"%@",@"211"];
                itm.h = [NSString stringWithFormat:@"%@",@"122"];
            }
            
            itm.allow_flip = [NSString stringWithFormat:@"%@",@"1"];
            itm.text_color = [NSString stringWithFormat:@"%@",@"#653b07"];
            
            NSString * imagName = [NSString stringWithFormat:@"bubblet%d",i+1];
            itm.image = [UIImage imageNamed:imagName];
            
            [defaultBubblesArray addObject:itm];
        }
        
        
        arr = [defaultBubblesArray copy];
        defaultBubblesArray = nil;
    }
    @catch (NSException *exception) {
        
    }
   
    return arr;
}


#pragma mark - home page -

+(NSArray *)generateHotSpotsItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:@"hotspotList.plist"  fromDoc:CTFileDocLibrary fromPath:@"cacheData/homepage"];
        NSMutableArray * infoMutableArr = [infoMutableDic objectForKey:@"list"];
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            for (NSDictionary * infoDic in infoMutableArr) {
                CTHotSpotsItem * itm = [[CTHotSpotsItem alloc] init];
                itm.group_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"group_id"]];
                itm.hotspot_name = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"hotspot_name"]];
                
                [mutableArr addObject:itm];
            }
        }
        
        arr = [mutableArr copy];
        mutableArr = nil;
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}

+(NSArray *)generateHotSpotsDetailItems:(CTHotSpotsItem *)itmModel
{
    NSArray * arr;
    
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * topicListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * likeListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * commentListMutableArr = [NSMutableArray arrayWithCapacity:0];
        
        NSString * fileNameStr = [NSString stringWithFormat:@"%@.plist",itmModel.group_id];
        NSMutableDictionary * infoDic = [CTFile getDicFile:fileNameStr fromDoc:CTFileDocLibrary fromPath:@"cacheData/homepage/hotspotList"];
   
        if (infoDic != nil || infoDic.count != 0) {
            
            
            NSArray * listArray = (NSArray *)[infoDic objectForKey:@"list"];
            
            for (NSDictionary * listInfoDic in listArray)
            {
                
                [topicListMutableArr removeAllObjects];
                [likeListMutableArr removeAllObjects];
                [commentListMutableArr removeAllObjects];
                
                CTHotSpotsDetailItem * itm = [[CTHotSpotsDetailItem alloc] init];
                CTFollowList * hotSpotsDetailItem = [[CTFollowList alloc] init];
                hotSpotsDetailItem.scheme_id = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"scheme_id"]];
                hotSpotsDetailItem.update_time = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"update_time"]];
                hotSpotsDetailItem.is_gif = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"is_gif"]];
                hotSpotsDetailItem.text = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"text"]];
                hotSpotsDetailItem.pic_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"pic_url"]];
                hotSpotsDetailItem.thumb_url= [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"thumb_url"]];
                hotSpotsDetailItem.like_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"like_counts"]];
                hotSpotsDetailItem.share_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"share_url"]];
                hotSpotsDetailItem.comment_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"comment_counts"]];
                hotSpotsDetailItem.liked = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"liked"]];
                
                
                NSArray * topicListArray = (NSArray *)[listInfoDic objectForKey:@"topic_list"];
                for (NSDictionary * topicListInfoDic in topicListArray) {
                    CTTopic * topicItem = [[CTTopic alloc] init];
                    topicItem.group_id = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"group_id"]];
                    topicItem.topic = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"topic"]];
                    
                    [topicListMutableArr addObject:topicItem];
                }
                hotSpotsDetailItem.topic_list = [topicListMutableArr copy];
                
                
                
                NSArray * likeListArray = (NSArray *)[listInfoDic objectForKey:@"like_list"];
                for (NSDictionary * likeListInfoDic in likeListArray) {
                    CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                    listDetailUser.uid = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"uid"]];
                    listDetailUser.name = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"name"]];
                    listDetailUser.gender = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"gender"]];
                    listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"profile_image_url_thumb"]];
                    
                    [likeListMutableArr addObject:listDetailUser];
                }
                hotSpotsDetailItem.like_list = [likeListMutableArr mutableCopy];
                
                
                
                
                NSArray * commentListArray = (NSArray *)[listInfoDic objectForKey:@"comment_list"];
                for (NSDictionary * commentListInfoDic in commentListArray) {
                    CTComment * commentItem = [[CTComment alloc] init];
                    
                    commentItem.user_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"user_id"]];
                    commentItem.update_time = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"update_time"]];
                    commentItem.comment_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"comment_id"]];
                    commentItem.text = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"text"]];
                    
                    
                    CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                    NSDictionary * userInfoDic = (NSDictionary *)[commentListInfoDic objectForKey:@"user"];
                    listDetailUser.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                    listDetailUser.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                    listDetailUser.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                    listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                    commentItem.user = listDetailUser;
                    
                    [commentListMutableArr addObject:commentItem];
                }
                hotSpotsDetailItem.comment_list = [commentListMutableArr copy];
                
                
                CTFollowListUser * followListUser = [[CTFollowListUser alloc] init];
                NSDictionary * userDic = (NSDictionary *)[listInfoDic objectForKey:@"user"];
                followListUser.uid = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"uid"]];
                followListUser.name = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"name"]];
                followListUser.gender = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"gender"]];
                followListUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"profile_image_url_thumb"]];
                followListUser.following = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"following"]];
                followListUser.verified = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified"]];
                followListUser.verified_reason = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified_reason"]];
                hotSpotsDetailItem.user = followListUser;
                
                itm.hotSpotsDetailItem = hotSpotsDetailItem;
                hotSpotsDetailItem = nil;
                [mutableArr addObject:itm];
            }
            arr = [mutableArr copy];
        }
        
        mutableArr = nil;
        likeListMutableArr = nil;
        commentListMutableArr = nil;
        topicListMutableArr = nil;
      
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}
+(CTSubjectItem *)generateSubjectItems:(CTHotSpotsItem *)itmModel
{    
    
    CTSubjectItem * itm ;
    
    @try {
        
        
        NSString * fileNameStr = [NSString stringWithFormat:@"%@.plist",itmModel.group_id];
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:fileNameStr fromDoc:CTFileDocLibrary fromPath:@"cacheData/homepage/subjectList"];
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            itm = [[CTSubjectItem alloc] init];
            
            itm.group_id = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"group_id"]];
            itm.group_name = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"group_name"]];
            itm.describe = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"describe"]];
            itm.update_time = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"update_time"]];
            itm.tag_official = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"tag_official"]];
            itm.tag_describe= [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"tag_describe"]];
            itm.tag_trends = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"tag_trends"]];
            itm.thumb = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"thumb"]];
            itm.url = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"url"]];
            itm.topic = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"topic"]];
            itm.temperature = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"temperature"]];
            itm.count = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"count"]];
            itm.is_mine = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"is_mine"]];
            itm.share_url = [NSString stringWithFormat:@"%@",[infoMutableDic objectForKey:@"share_url"]];
            
            NSDictionary * userDic = [infoMutableDic objectForKey:@"user"];
            CTSubjectUserItem * userItem = [[CTSubjectUserItem alloc] init];
            userItem.uid = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"uid"]];
            userItem.name = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"name"]];
            userItem.gender = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"gender"]];
            userItem.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"profile_image_url_thumb"]];
            userItem.following = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"following"]];
            itm.user = userItem;
            
            NSDictionary * bubbleDic = [infoMutableDic objectForKey:@"bubble"];
            CTSubjectBubbleItem * bubbleItem = [[CTSubjectBubbleItem alloc] init];
            bubbleItem.name = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"name"]];
            bubbleItem.thumb = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"thumb"]];
            bubbleItem.url = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"url"]];
            bubbleItem.x = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"x"]];
            bubbleItem.y = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"y"]];
            bubbleItem.w = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"w"]];
            bubbleItem.h = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"h"]];
            bubbleItem.text_color = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"text_color"]];
            bubbleItem.allow_flip = [NSString stringWithFormat:@"%@",[bubbleDic objectForKey:@"allow_flip"]];
            itm.bubble = bubbleItem;
            
            NSDictionary * hotspotDic = [infoMutableDic objectForKey:@"hotspot"];
            CTSubjectHotSpotItem * hotspotItem = [[CTSubjectHotSpotItem alloc] init];
            hotspotItem.name = [NSString stringWithFormat:@"%@",[hotspotDic objectForKey:@"name"]];
            hotspotItem.describe = [NSString stringWithFormat:@"%@",[hotspotDic objectForKey:@"describe"]];
            hotspotItem.thumb = [NSString stringWithFormat:@"%@",[hotspotDic objectForKey:@"thumb"]];
            itm.hotspot = hotspotItem;
            
            NSDictionary * zipDic = [infoMutableDic objectForKey:@"zip"];
            CTSubjectZipItem * zipItem = [[CTSubjectZipItem alloc] init];
            zipItem.url = [NSString stringWithFormat:@"%@",[zipDic objectForKey:@"url"]];
            zipItem.size = [NSString stringWithFormat:@"%@",[zipDic objectForKey:@"size"]];
            itm.zip = zipItem;
            
            
            NSArray * listArray = [infoMutableDic objectForKey:@"list"];
            NSMutableArray * listMutableArray = [NSMutableArray arrayWithCapacity:0];
            [listMutableArray removeAllObjects];
            for (NSDictionary * listInfoDic in listArray) {
                CTSubjectDetailItem * listItem = [[CTSubjectDetailItem alloc] init];
                listItem.scheme_id = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"scheme_id"]];
                listItem.thumb = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"thumb"]];
                listItem.url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"url"]];
                
                [listMutableArray addObject:listItem];
            }
            itm.list = [listMutableArray copy];
            listMutableArray = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return itm;
}



#pragma mark - discovery -



+(NSArray *)generateFollowListItems
{
    NSArray * arr;
    
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * topicListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * likeListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * commentListMutableArr = [NSMutableArray arrayWithCapacity:0];
        
        NSMutableDictionary * infoDic = [CTFile getDicFile:@"followList.plist" fromDoc:CTFileDocLibrary fromPath:@"cacheData/discovery"];
        
        if (infoDic != nil || infoDic.count != 0) {
            NSArray * listArray = (NSArray *)[infoDic objectForKey:@"list"];
            
            for (NSDictionary * listInfoDic in listArray) {
                
                [topicListMutableArr removeAllObjects];
                [likeListMutableArr removeAllObjects];
                [commentListMutableArr removeAllObjects];
                
                
                CTFollowList *  itm = [[CTFollowList alloc] init];
                itm.scheme_id = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"scheme_id"]];
                itm.update_time = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"update_time"]];
                itm.is_gif = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"is_gif"]];
                itm.text = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"text"]];
                itm.pic_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"pic_url"]];
                itm.thumb_url= [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"thumb_url"]];
                itm.like_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"like_counts"]];
                itm.comment_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"comment_counts"]];
                itm.liked = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"liked"]];
                itm.share_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"share_url"]];
                
                
                NSArray * topicListArray = (NSArray *)[listInfoDic objectForKey:@"topic_list"];
                for (NSDictionary * topicListInfoDic in topicListArray) {
                    CTTopic * topicItem = [[CTTopic alloc] init];
                    topicItem.group_id = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"group_id"]];
                    topicItem.topic = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"topic"]];
                    
                    [topicListMutableArr addObject:topicItem];
                }
                itm.topic_list = [topicListMutableArr copy];
                
                
                
                NSArray * likeListArray = (NSArray *)[listInfoDic objectForKey:@"like_list"];
                for (NSDictionary * likeListInfoDic in likeListArray) {
                    CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                    listDetailUser.uid = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"uid"]];
                    listDetailUser.name = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"name"]];
                    listDetailUser.gender = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"gender"]];
                    listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"profile_image_url_thumb"]];
                    
                    [likeListMutableArr addObject:listDetailUser];
                }
                itm.like_list = [likeListMutableArr mutableCopy];
                
                
                
                
                NSArray * commentListArray = (NSArray *)[listInfoDic objectForKey:@"comment_list"];
                for (NSDictionary * commentListInfoDic in commentListArray) {
                    CTComment * commentItem = [[CTComment alloc] init];
                    
                    commentItem.user_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"user_id"]];
                    commentItem.update_time = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"update_time"]];
                    commentItem.comment_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"comment_id"]];
                    commentItem.text = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"text"]];
                    
                    
                    CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                    NSDictionary * userInfoDic = (NSDictionary *)[commentListInfoDic objectForKey:@"user"];
                    listDetailUser.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                    listDetailUser.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                    listDetailUser.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                    listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                    commentItem.user = listDetailUser;
                    
                    [commentListMutableArr addObject:commentItem];
                }
                itm.comment_list = [commentListMutableArr copy];
                
                
                CTFollowListUser * followListUser = [[CTFollowListUser alloc] init];
                NSDictionary * userDic = (NSDictionary *)[listInfoDic objectForKey:@"user"];
                followListUser.uid = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"uid"]];
                followListUser.name = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"name"]];
                followListUser.gender = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"gender"]];
                followListUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"profile_image_url_thumb"]];
                followListUser.following = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"following"]];
                followListUser.verified = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified"]];
                followListUser.verified_reason = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified_reason"]];
                itm.user = followListUser;
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}

+(NSArray *)generateUserSuggestionItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * infoMutableArr = [CTFile getArrFile:@"userSuggestion.plist" fromDoc:CTFileDocLibrary  fromPath:@"cacheData/discovery"];
        
        if (infoMutableArr != nil || infoMutableArr.count != 0) {
         
            for (NSDictionary * userInfoDic in infoMutableArr) {
                
                CTUserSuggestionItem * itm = [[CTUserSuggestionItem alloc] init];
                CTUserItem * user = [[CTUserItem alloc] init];
                user.created_at = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"created_at"]];
                user.follow_me = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"follow_me"]];
                user.followers_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"followers_count"]];
                user.following = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"following"]];
                user.friends_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"friends_count"]];
                user.group_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"group_count"]];
                user.mine_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"mine_count"]];
                user.modified_name_at = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"modified_name_at"]];
                user.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                user.profile_image_url = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url"]];
                user.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                user.sign = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"sign"]];
                user.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                user.verified = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified"]];
                user.verified_reason = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_reason"]];
                user.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                user.public_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"public_count"]];
                user.verified_weibo = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_weibo"]];
                user.verified_shop = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_shop"]];
                itm.user = user;
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}




#pragma mark - message -

+(NSArray *)generatePersonalMessageListItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSString * fileNameStr = @"visitor";
        CTUserItem * userItem = [CTUser userInfo];
        if (userItem != nil)fileNameStr = [NSString stringWithFormat:@"%@.plist",userItem.uid];
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:fileNameStr fromDoc:CTFileDocLibrary fromPath:@"cacheData/message/personalMesg"];
        
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            
            NSArray * listArray = (NSArray *)[infoMutableDic objectForKey:@"list"];
            
            for (NSDictionary * infoDic in listArray) {
                CTMessageListItem * itm = [[CTMessageListItem alloc] init];
                itm.notice_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"notice_id"]];
                itm.type = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"type"]];
                itm.comment_text = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"comment_text"]];
                itm.scheme_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"scheme_id"]];
                itm.thumb = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"thumb"]];
                itm.comment_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"comment_id"]];
                itm.update_time = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"update_time"]];
                itm.isRead = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"isRead"]];
                
                CTMessageUserItem * userItem = [[CTMessageUserItem alloc] init];
                NSDictionary * userInfoDic = [infoDic objectForKey:@"user"];
                userItem.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                userItem.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                userItem.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                userItem.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                userItem.following = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"following"]];
                userItem.verified = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified"]];
                userItem.verified_reason = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_reason"]];
                
                itm.user = userItem;
                
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}

+(NSArray *)generateOfficialMessageListItems
{
    NSArray * arr;
    @try {
        
        NSString * fileNameStr;
        CTUserItem * userItem = [CTUser userInfo];
        if (userItem != nil)fileNameStr = [NSString stringWithFormat:@"%@.plist",userItem.uid];
        else fileNameStr = @"visitor.plist";
        
        
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * infoMutableArr = [CTFile getArrFile:fileNameStr fromDoc:CTFileDocLibrary fromPath:@"cacheData/message/officialMesg"];
        
        if (infoMutableArr != nil || infoMutableArr.count != 0) {
            
            for (NSDictionary * infoDic in infoMutableArr) {
                CTOfficialMessageItem * itm = [[CTOfficialMessageItem alloc] init];
                itm.content = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"content"]];
                itm.isRead = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"isRead"]];
               
                NSDictionary * extrasDic = [infoDic objectForKey:@"extras"];
                CTOfficialMessageExtrasItem * extrasItm = [[CTOfficialMessageExtrasItem alloc] init];
                extrasItm.key = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"key"]];
                extrasItm.message_type = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"message_type"]];
                extrasItm.send_avatar = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"send_avatar"]];
                extrasItm.send_name = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"send_name"]];
                extrasItm.send_time = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"send_time"]];
                extrasItm.send_uid = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"send_uid"]];
                extrasItm.type = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"type"]];
                extrasItm.notice_id = [NSString stringWithFormat:@"%@",[extrasDic objectForKey:@"notice_id"]];
                
                itm.extras = extrasItm;
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}


+(NSString *)generateMessageSwitch
{
    NSString * switchStr;
    @try {
        switchStr = [CTFile getFile:@"switch.text" fromDoc:CTFileDocLibrary fromPath:@"cacheData/message/switch"];
    }
    @catch (NSException *exception) {
        
    }
    
    return switchStr;
}


#pragma mark - user -

+(NSArray *)generateFenceUserListItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:@"fenceUserList.plist" fromDoc:CTFileDocLibrary fromPath:@"cacheData/user"];
        
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
         
            NSArray * listArray = (NSArray *)[infoMutableDic objectForKey:@"list"];
            
            for (NSDictionary * userInfoDic in listArray) {
                CTUserItem * itm = [[CTUserItem alloc] init];
                itm.created_at = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"created_at"]];
                itm.follow_me = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"follow_me"]];
                itm.followers_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"followers_count"]];
                itm.following = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"following"]];
                itm.friends_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"friends_count"]];
                itm.group_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"group_count"]];
                itm.mine_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"mine_count"]];
                itm.modified_name_at = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"modified_name_at"]];
                itm.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                itm.profile_image_url = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url"]];
                itm.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                itm.sign = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"sign"]];
                itm.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                itm.verified = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified"]];
                itm.verified_reason = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_reason"]];
                itm.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                itm.public_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"public_count"]];
                itm.verified_shop = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_shop"]];
                itm.verified_weibo = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_weibo"]];
                
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}


+(NSArray *)generateFollowUserListItems
{
    NSArray * arr;
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:@"followUserList.plist" fromDoc:CTFileDocLibrary fromPath:@"cacheData/user"];
        
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            
            NSArray * listArray = (NSArray *)[infoMutableDic objectForKey:@"list"];
            
            for (NSDictionary * userInfoDic in listArray) {
                CTUserItem * itm = [[CTUserItem alloc] init];
                itm.created_at = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"created_at"]];
                itm.follow_me = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"follow_me"]];
                itm.followers_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"followers_count"]];
                itm.following = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"following"]];
                itm.friends_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"friends_count"]];
                itm.group_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"group_count"]];
                itm.mine_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"mine_count"]];
                itm.modified_name_at = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"modified_name_at"]];
                itm.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                itm.profile_image_url = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url"]];
                itm.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                itm.sign = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"sign"]];
                itm.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                itm.verified = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified"]];
                itm.verified_reason = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_reason"]];
                itm.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                itm.public_count = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"public_count"]];
                itm.verified_shop = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_shop"]];
                itm.verified_weibo = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"verified_weibo"]];
                
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
            
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}



+(NSArray *)generateUserPublishDetailListItems
{
    NSArray * arr;
    
    @try {
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * topicListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * likeListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * commentListMutableArr = [NSMutableArray arrayWithCapacity:0];
        
       
        NSMutableDictionary * infoDic = [CTFile getDicFile:@"userPublishDetailList.plist" fromDoc:CTFileDocLibrary fromPath:@"cacheData/user"];
        
       
        
        if (infoDic != nil || infoDic.count != 0) {
            
            
            NSArray * listArray = (NSArray *)[infoDic objectForKey:@"list"];
            
            for (NSDictionary * listInfoDic in listArray)
            {
                
                [topicListMutableArr removeAllObjects];
                [likeListMutableArr removeAllObjects];
                [commentListMutableArr removeAllObjects];
                
              //  CTUserPublishDetailListItem * itm = [[CTUserPublishDetailListItem alloc] init];
                CTFollowList * hotSpotsDetailItem = [[CTFollowList alloc] init];
                hotSpotsDetailItem.scheme_id = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"scheme_id"]];
                hotSpotsDetailItem.update_time = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"update_time"]];
                hotSpotsDetailItem.is_gif = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"is_gif"]];
                hotSpotsDetailItem.text = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"text"]];
                hotSpotsDetailItem.pic_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"pic_url"]];
                hotSpotsDetailItem.thumb_url= [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"thumb_url"]];
                hotSpotsDetailItem.like_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"like_counts"]];
                hotSpotsDetailItem.share_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"share_url"]];
                hotSpotsDetailItem.comment_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"comment_counts"]];
                hotSpotsDetailItem.liked = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"liked"]];
                
                
                NSArray * topicListArray = (NSArray *)[listInfoDic objectForKey:@"topic_list"];
                for (NSDictionary * topicListInfoDic in topicListArray) {
                    CTTopic * topicItem = [[CTTopic alloc] init];
                    topicItem.group_id = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"group_id"]];
                    topicItem.topic = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"topic"]];
                    
                    [topicListMutableArr addObject:topicItem];
                }
                hotSpotsDetailItem.topic_list = [topicListMutableArr copy];
                
                
                
                NSArray * likeListArray = (NSArray *)[listInfoDic objectForKey:@"like_list"];
                for (NSDictionary * likeListInfoDic in likeListArray) {
                    CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                    listDetailUser.uid = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"uid"]];
                    listDetailUser.name = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"name"]];
                    listDetailUser.gender = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"gender"]];
                    listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"profile_image_url_thumb"]];
                    
                    [likeListMutableArr addObject:listDetailUser];
                }
                hotSpotsDetailItem.like_list = [likeListMutableArr mutableCopy];
                
                
                
                
                NSArray * commentListArray = (NSArray *)[listInfoDic objectForKey:@"comment_list"];
                for (NSDictionary * commentListInfoDic in commentListArray) {
                    CTComment * commentItem = [[CTComment alloc] init];
                    
                    commentItem.user_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"user_id"]];
                    commentItem.update_time = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"update_time"]];
                    commentItem.comment_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"comment_id"]];
                    commentItem.text = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"text"]];
                    
                    
                    CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                    NSDictionary * userInfoDic = (NSDictionary *)[commentListInfoDic objectForKey:@"user"];
                    listDetailUser.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                    listDetailUser.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                    listDetailUser.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                    listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                    commentItem.user = listDetailUser;
                    
                    [commentListMutableArr addObject:commentItem];
                }
                hotSpotsDetailItem.comment_list = [commentListMutableArr copy];
                
                
                CTFollowListUser * followListUser = [[CTFollowListUser alloc] init];
                NSDictionary * userDic = (NSDictionary *)[listInfoDic objectForKey:@"user"];
                followListUser.uid = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"uid"]];
                followListUser.name = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"name"]];
                followListUser.gender = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"gender"]];
                followListUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"profile_image_url_thumb"]];
                followListUser.following = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"following"]];
                followListUser.verified = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified"]];
                followListUser.verified_reason = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified_reason"]];
                hotSpotsDetailItem.user = followListUser;
                
              //  itm.hotSpotsDetailItem = hotSpotsDetailItem;
                [mutableArr addObject:hotSpotsDetailItem];
            }
            arr = [mutableArr copy];
        }
        
        mutableArr = nil;
        likeListMutableArr = nil;
        commentListMutableArr = nil;
        topicListMutableArr = nil;
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}








#pragma mark - other -

+(NSArray *)generateCommentListItems
{
    NSArray * arr;
    @try {
        
        NSMutableArray * mutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableDictionary * infoMutableDic = [CTFile getDicFile:@"commentList.plist" fromDoc:CTFileDocLibrary fromPath:@"cacheData/other"];
        
        if (infoMutableDic != nil || infoMutableDic.count != 0) {
            
            NSArray * listArray = (NSArray *)[infoMutableDic objectForKey:@"list"];
            
            for (NSDictionary * infoDic in listArray) {
                
                CTCommentListItems * itm = [[CTCommentListItems alloc] init];
                CTComment * commentItem = [[CTComment alloc] init];
                CTListDetailUser * userItem = [[CTListDetailUser alloc] init];
                
                commentItem.user_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"user_id"]];
                commentItem.comment_id = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"comment_id"]];
                commentItem.text = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"text"]];
                commentItem.update_time = [NSString stringWithFormat:@"%@",[infoDic objectForKey:@"update_time"]];
                
                NSDictionary * userInfoDic = [infoDic objectForKey:@"user"];
                userItem.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                userItem.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                userItem.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                userItem.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                commentItem.user = userItem;
                itm.commentItem = commentItem;
                
                [mutableArr addObject:itm];
            }
            
            arr = [mutableArr copy];
            mutableArr = nil;
        }
        
    }
    @catch (NSException *exception) {
        
    }
    
    return arr;
}


+(CTFollowList *)generatePublishDetailsInfo
{
    CTFollowList * hotSpotsDetailItem;
    
    @try {
    
        NSMutableArray * topicListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * likeListMutableArr = [NSMutableArray arrayWithCapacity:0];
        NSMutableArray * commentListMutableArr = [NSMutableArray arrayWithCapacity:0];
        
       
        NSMutableDictionary * listInfoDic = [CTFile getDicFile:@"userPublishDetailInfoList.plist" fromDoc:CTFileDocLibrary fromPath:@"cacheData/user"];
        
        
        if (listInfoDic != nil || listInfoDic.count != 0) {
            
            
            [topicListMutableArr removeAllObjects];
            [likeListMutableArr removeAllObjects];
            [commentListMutableArr removeAllObjects];
            
           
            hotSpotsDetailItem = [[CTFollowList alloc] init];
            hotSpotsDetailItem.scheme_id = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"scheme_id"]];
            hotSpotsDetailItem.update_time = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"update_time"]];
            hotSpotsDetailItem.is_gif = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"is_gif"]];
            hotSpotsDetailItem.text = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"text"]];
            hotSpotsDetailItem.pic_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"pic_url"]];
            hotSpotsDetailItem.thumb_url= [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"thumb_url"]];
            hotSpotsDetailItem.like_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"like_counts"]];
            hotSpotsDetailItem.comment_counts = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"comment_counts"]];
            hotSpotsDetailItem.liked = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"liked"]];
            hotSpotsDetailItem.share_url = [NSString stringWithFormat:@"%@",[listInfoDic objectForKey:@"share_url"]];
            
            NSArray * topicListArray = (NSArray *)[listInfoDic objectForKey:@"topic_list"];
            for (NSDictionary * topicListInfoDic in topicListArray) {
                CTTopic * topicItem = [[CTTopic alloc] init];
                topicItem.group_id = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"group_id"]];
                topicItem.topic = [NSString stringWithFormat:@"%@",[topicListInfoDic objectForKey:@"topic"]];
                
                [topicListMutableArr addObject:topicItem];
            }
            hotSpotsDetailItem.topic_list = [topicListMutableArr copy];
            
            
            
            NSArray * likeListArray = (NSArray *)[listInfoDic objectForKey:@"like_list"];
            for (NSDictionary * likeListInfoDic in likeListArray) {
                CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                listDetailUser.uid = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"uid"]];
                listDetailUser.name = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"name"]];
                listDetailUser.gender = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"gender"]];
                listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[likeListInfoDic objectForKey:@"profile_image_url_thumb"]];
                
                [likeListMutableArr addObject:listDetailUser];
            }
            hotSpotsDetailItem.like_list = [likeListMutableArr mutableCopy];
            
            
            
            
            NSArray * commentListArray = (NSArray *)[listInfoDic objectForKey:@"comment_list"];
            for (NSDictionary * commentListInfoDic in commentListArray) {
                CTComment * commentItem = [[CTComment alloc] init];
                
                commentItem.user_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"user_id"]];
                commentItem.update_time = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"update_time"]];
                commentItem.comment_id = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"comment_id"]];
                commentItem.text = [NSString stringWithFormat:@"%@",[commentListInfoDic objectForKey:@"text"]];
                
                
                CTListDetailUser * listDetailUser = [[CTListDetailUser alloc] init];
                NSDictionary * userInfoDic = (NSDictionary *)[commentListInfoDic objectForKey:@"user"];
                listDetailUser.uid = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"uid"]];
                listDetailUser.name = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"name"]];
                listDetailUser.gender = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"gender"]];
                listDetailUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userInfoDic objectForKey:@"profile_image_url_thumb"]];
                commentItem.user = listDetailUser;
                
                [commentListMutableArr addObject:commentItem];
            }
            hotSpotsDetailItem.comment_list = [commentListMutableArr copy];
            
            
            CTFollowListUser * followListUser = [[CTFollowListUser alloc] init];
            NSDictionary * userDic = (NSDictionary *)[listInfoDic objectForKey:@"user"];
            followListUser.uid = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"uid"]];
            followListUser.name = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"name"]];
            followListUser.gender = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"gender"]];
            followListUser.profile_image_url_thumb = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"profile_image_url_thumb"]];
            followListUser.following = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"following"]];
            followListUser.verified = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified"]];
            followListUser.verified_reason = [NSString stringWithFormat:@"%@",[userDic objectForKey:@"verified_reason"]];
            hotSpotsDetailItem.user = followListUser;
            
        }
        
        likeListMutableArr = nil;
        commentListMutableArr = nil;
        topicListMutableArr = nil;
        
    }
    @catch (NSException *exception) {
        hotSpotsDetailItem = [[CTFollowList alloc] init];
    }
    
    return hotSpotsDetailItem;
}


@end
